package com.kexinde.wjifen.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 * 
 * @author wei
 * 
 * 活动消息
 *
 */
@Entity
public class Activity {

	private long id;  // 活动编号
	private String name;  // 活动名
	private String introduce;  // 介绍
	private Date starTime;  // 起始时间
	private Date endTime;  // 结束时间
	private String picturePath;  // 图片
	private Shop shop; // 商店
	
	public Activity(){}

	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIntroduce() {
		return introduce;
	}

	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}

	public Date getStarTime() {
		return starTime;
	}

	public void setStarTime(Date starTime) {
		this.starTime = starTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getPicturePath() {
		return picturePath;
	}

	public void setPicturePath(String picturePath) {
		this.picturePath = picturePath;
	}

	@ManyToOne(cascade=CascadeType.ALL)
	public Shop getShop() {
		return shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}

	@Override
	public String toString() {
		return "Activity [id=" + id + ", name=" + name + ", introduce="
				+ introduce + ", starTime=" + starTime + ", endTime=" + endTime
				+ ", picturePath=" + picturePath + ", shop=" + shop + "]";
	}
	
}
